/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package CarProject.impl;

import CarProject.CarProjectPackage;
import CarProject.VueGenerale;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Vue Generale</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link CarProject.impl.VueGeneraleImpl#getDirige <em>Dirige</em>}</li>
 *   <li>{@link CarProject.impl.VueGeneraleImpl#getNomVue <em>Nom Vue</em>}</li>
 *   <li>{@link CarProject.impl.VueGeneraleImpl#getTitre <em>Titre</em>}</li>
 *   <li>{@link CarProject.impl.VueGeneraleImpl#getReference <em>Reference</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class VueGeneraleImpl extends EObjectImpl implements VueGenerale {
	/**
	 * The cached value of the '{@link #getDirige() <em>Dirige</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDirige()
	 * @generated
	 * @ordered
	 */
	protected EList dirige;

	/**
	 * The default value of the '{@link #getNomVue() <em>Nom Vue</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNomVue()
	 * @generated
	 * @ordered
	 */
	protected static final String NOM_VUE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getNomVue() <em>Nom Vue</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNomVue()
	 * @generated
	 * @ordered
	 */
	protected String nomVue = NOM_VUE_EDEFAULT;

	/**
	 * The default value of the '{@link #getTitre() <em>Titre</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTitre()
	 * @generated
	 * @ordered
	 */
	protected static final String TITRE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getTitre() <em>Titre</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTitre()
	 * @generated
	 * @ordered
	 */
	protected String titre = TITRE_EDEFAULT;

	/**
	 * The cached value of the '{@link #getReference() <em>Reference</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReference()
	 * @generated
	 * @ordered
	 */
	protected EList reference;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected VueGeneraleImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return CarProjectPackage.Literals.VUE_GENERALE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getDirige() {
		if (dirige == null) {
			dirige = new EObjectContainmentEList(VueGenerale.class, this, CarProjectPackage.VUE_GENERALE__DIRIGE);
		}
		return dirige;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getNomVue() {
		return nomVue;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNomVue(String newNomVue) {
		String oldNomVue = nomVue;
		nomVue = newNomVue;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_GENERALE__NOM_VUE, oldNomVue, nomVue));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getTitre() {
		return titre;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTitre(String newTitre) {
		String oldTitre = titre;
		titre = newTitre;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CarProjectPackage.VUE_GENERALE__TITRE, oldTitre, titre));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getReference() {
		if (reference == null) {
			reference = new EObjectResolvingEList(VueGenerale.class, this, CarProjectPackage.VUE_GENERALE__REFERENCE);
		}
		return reference;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CarProjectPackage.VUE_GENERALE__DIRIGE:
				return ((InternalEList)getDirige()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CarProjectPackage.VUE_GENERALE__DIRIGE:
				return getDirige();
			case CarProjectPackage.VUE_GENERALE__NOM_VUE:
				return getNomVue();
			case CarProjectPackage.VUE_GENERALE__TITRE:
				return getTitre();
			case CarProjectPackage.VUE_GENERALE__REFERENCE:
				return getReference();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CarProjectPackage.VUE_GENERALE__DIRIGE:
				getDirige().clear();
				getDirige().addAll((Collection)newValue);
				return;
			case CarProjectPackage.VUE_GENERALE__NOM_VUE:
				setNomVue((String)newValue);
				return;
			case CarProjectPackage.VUE_GENERALE__TITRE:
				setTitre((String)newValue);
				return;
			case CarProjectPackage.VUE_GENERALE__REFERENCE:
				getReference().clear();
				getReference().addAll((Collection)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case CarProjectPackage.VUE_GENERALE__DIRIGE:
				getDirige().clear();
				return;
			case CarProjectPackage.VUE_GENERALE__NOM_VUE:
				setNomVue(NOM_VUE_EDEFAULT);
				return;
			case CarProjectPackage.VUE_GENERALE__TITRE:
				setTitre(TITRE_EDEFAULT);
				return;
			case CarProjectPackage.VUE_GENERALE__REFERENCE:
				getReference().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CarProjectPackage.VUE_GENERALE__DIRIGE:
				return dirige != null && !dirige.isEmpty();
			case CarProjectPackage.VUE_GENERALE__NOM_VUE:
				return NOM_VUE_EDEFAULT == null ? nomVue != null : !NOM_VUE_EDEFAULT.equals(nomVue);
			case CarProjectPackage.VUE_GENERALE__TITRE:
				return TITRE_EDEFAULT == null ? titre != null : !TITRE_EDEFAULT.equals(titre);
			case CarProjectPackage.VUE_GENERALE__REFERENCE:
				return reference != null && !reference.isEmpty();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (NomVue: ");
		result.append(nomVue);
		result.append(", Titre: ");
		result.append(titre);
		result.append(')');
		return result.toString();
	}

} //VueGeneraleImpl
